// 引入windi css
import '@/plugins/windi.css'

// 导入全局的svg图标
import '@/plugins/svgIcon'

// 初始化多语言
import { setupI18n } from '@/plugins/vueI18n'

// 引入状态管理
import { setupStore } from '@/store'

// 全局组件
import { setupGlobCom } from '@/components'

// 引入element-plus
import { setupElementPlus } from '@/plugins/elementPlus'

// 引入全局样式
import '@/styles/index.less'

// 引入动画
import '@/plugins/animate.css'

// 路由
import { setupRouter } from './router'
// import { message } from '@/utils/resetMessage'
import { createApp } from 'vue'
import App from './App.vue'
//全局配置elementplus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import filters from '@/utils/filters'
import btnAntiShake from '@/utils/btnAntiShake' //防抖
import vForm from 'ezlcp-form-vue3'
import 'ezlcp-form-vue3/dist/designer.style.css'
import './permission'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 创建实例
const setupAll = async () => {
  const app = createApp(App)
  await setupI18n(app)
  setupStore(app)
  setupGlobCom(app)
  setupElementPlus(app)
  setupRouter(app)
  app.use(ElementPlus) //添加
  app.use(vForm)
  app.use(btnAntiShake) //添加防抖
  app.mount('#app')
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
  app.config.globalProperties.$filters = filters //金额全局过滤器
  // app.config.globalProperties.$message = message
  // Vue.prototype.$message = newMessage;
}
setupAll()
